package com.cloud.util;

import org.jsoup.Connection;
import org.jsoup.Jsoup;


public class SpiderUtil {

    private int timeOut;

    private String referer;

    private static final String userAgent = CookieUtil.USER_AGENT;

    public SpiderUtil() {

    }

    public SpiderUtil(String referer, int timeOut) {
        this.timeOut = timeOut;
        this.referer = referer;
    }

    public int getTimeOut() {
        return timeOut;
    }

    public void setTimeOut(int timeOut) {
        this.timeOut = timeOut;
    }

    public String getReferer() {
        return referer;
    }

    public void setReferer(String referer) {
        this.referer = referer;
    }

    public Connection connect(String url) {
        return Jsoup.connect(url).userAgent(userAgent).referrer(referer).timeout(timeOut);
    }
}
